<?php
function _escapeChars_2( $s ){
    $s = preg_replace( '/~/'  , '~126;' ,$s );
    $s = preg_replace( '/\\\\/' , '~92;'  ,$s );
    $s = preg_replace( '/\//' , '~47;'  ,$s );
    $s = preg_replace( '/\:/' , '~58;'  ,$s );
    $s = preg_replace( '/\*/' , '~42;'  ,$s );
    $s = preg_replace( '/\?/' , '~63;'  ,$s );
    $s = preg_replace( '/\"/' , '~34;'  ,$s ); //'39   #35  htmlspecialchars
    //$s = preg_replace( '/</'  , '~60;'  ,$s );  //htmlspecialchars
   // $s = preg_replace( '/>/'  , '~62;'  ,$s );  //htmlspecialchars
    $s = preg_replace( '/\|/' , '~124;' ,$s );
	
    $s = preg_replace( '/\'/' , '~39;'  ,$s ); //htmlspecialchars  
    //$s = preg_replace( '/&/'  , '~38;'  ,$s );  //htmlspecialchars
			   
    //$s = preg_replace( '/\{/' , '~123;' ,$s );
    //$s = preg_replace( '/\}/' , '~125;' ,$s );
	
	//$s = preg_replace( '/\s/' , '~s;' ,$s );
	// $s = preg_replace( '/\t/' , '~t;' ,$s );
	 $s = preg_replace( '/\r/' , '~r;' ,$s );
	 $s = preg_replace( '/\n/' , '~n;' ,$s );
	//$s=urlencode($s);
    return $s;
}
//$str = 'http://www.jb51.net\article/23144.htm';
//echo _escapeChars( $str );
?>